Skip to content

feat(hypergraph): use native spaceId/spaceIds/typeIds filters for entities query#588

Merged
nikgraf merged 1 commit intomainfrom
feat/use-native-space-type-filters
Jan 29, 2026
Merged

feat(hypergraph): use native spaceId/spaceIds/typeIds filters for entities query#588
nikgraf merged 1 commit intomainfrom
feat/use-native-space-type-filters

Conversation

@baiirun
Copy link
Contributor

@baiirun baiirun commented Jan 26, 2026

Summary

  • Updates findManyPublic to use the new native spaceId, spaceIds, and typeIds filters added in geobrowser/gaia#293
  • These native filters use indexed EXISTS subqueries instead of computed functions that ran O(n) subqueries per row
  • entitiesOrderedByProperty query still uses the old approach since it doesn't yet support native typeIds filter

Changes

For the regular entities query:

  • spaceId: $spaceId as a top-level argument (single space)
  • spaceIds: {in: $spaceIds} as a top-level argument (multi-space)
  • typeIds: {in: $typeIds} as a top-level argument (replaces relation-based filter)

…ities query

The gaia API (geobrowser/gaia#293) added efficient native filters for the
entities query: spaceId, spaceIds, typeId, and typeIds. These use indexed
EXISTS subqueries instead of the previous approach which ran 2 subqueries
per row causing O(n) overhead.

This change updates findManyPublic to use the new native filters:
- spaceId/spaceIds as top-level query arguments instead of inside filter
- typeIds as a top-level argument instead of relation-based filtering

The entitiesOrderedByProperty query still uses the old approach since it
doesn't yet support the native typeIds filter.
@nikgraf nikgraf merged commit 506b0fb into main Jan 29, 2026
6 checks passed
@nikgraf nikgraf deleted the feat/use-native-space-type-filters branch January 29, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants